package main

import (
	"fmt"
	"net/rpc"
)

type AddRequest struct {
	Left  int
	Right int
}

type AddResponse struct {
	Result int
}

type Calc struct {
}

func main() {
	client, err := rpc.DialHTTP("tcp", "127.0.0.1:8888")
	if err != nil {
		fmt.Println(err)
		return
	}
	defer client.Close()
	req := AddRequest{2, 8}
	resp := AddResponse{}
	err = client.Call("Calc.Add", req, &resp)
	if err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(resp)
}
